﻿using System.Data;
using System.Collections.ObjectModel;
using Microsoft.Office.Server.Search.Query;

namespace SharePointSearchBench.Library
{
    /// <summary>
    /// Defines the contract that an underlying search context
    /// must implement for performing searches and obtaining
    /// search metadata.
    /// </summary>
    public interface ISearchBenchContext
    {
        /// <summary>
        /// Defines a method that is called to initialize any objects
        /// used for searching.
        /// </summary>
        void PrepareSearch();

        /// <summary>
        /// Defines a method that is called to perform a search operation
        /// and return results.
        /// </summary>
        /// <returns></returns>
        DataSet Execute();

        /// <summary>
        /// Defines a method that is called to obtain an available list of managed properties.
        /// </summary>
        /// <returns></returns>
        Collection<SearchProperty> GetSearchProperties();

        /// <summary>
        /// Defines a method that is called to obtain an available list of search scopes.
        /// </summary>
        /// <returns></returns>
        Collection<SearchScope> GetScopes();

        /// <summary>
        /// Indiciates whether the implementing class requires credentials to be set before making a call.
        /// </summary>
        bool RequiresCredentials { get; }
    }
}
